﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>共享文档</title>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta http-equiv="Pragma" content="no-cache" />
    <meta http-equiv="Cache-Control" content="no-cache" />
    <meta http-equiv="Expires" content="0" />
    <meta name="renderer" content="webkit">
    <link href="/CSS/bootstrap3.3.5/css/bootstrap.css" rel="stylesheet" type="text/css" />
    <link href="/CSS/Base/BaseClass.css?cssver=4" rel="stylesheet" type="text/css" />
    <link href="/CSS/font-awesome-4.3.0/css/font-awesome.min.css" rel="stylesheet">
    <link href="/CSS/Base/hover.css" rel="stylesheet" type="text/css" />
</head>
<body ms-controller="APP_QYWD">
    <script type="avalon" id="tpllist">
        <ol class="breadcrumb" style="margin-bottom:0;font-weight:bold;background-color:white" ms-controller="APP_QYWD_GX">
            <li ms-click="initdata()"><a href="#">共享文档</a></li>
            <li ms-click="enteruser(seluser)"><a href="#">{{ComFunJS.convertuser(seluser)}}</a></li>
            <li ms-repeat-path="Pathdata" ms-class="active:path.active" ms-click="gopath(path)"><a href="#">{{path.Name}}</a></li>
        </ol>
        <ul class="listContent">
            <li class="lifile hvr-float-shadow" ms-repeat-item="ListData" ms-class-1="selli:item.issel" ms-on-mousedown="filecontextmenu(item,event)" data-repeat-rendered="filechange" ms-on-dblclick="viewitem(item,$(this))" ms-attr-title="item.CRDate">
                <span class="badge newbadge" ms-if="ComFunJS.daysBetween(ComFunJS.getnowdate('yyyy-mm-dd'), item.CRDate.substring(0,10)) == 0||ComFunJS.daysBetween(ComFunJS.getnowdate('yyyy-mm-dd'), item.CRDate.substring(0,10)) == -1">新</span>
                <i ms-click="selItems(item,event)" class="iconfont" ms-class-1="icon-weigouxuan:!item.issel" ms-class-2="icon-gouxuan:item.issel"></i>
                <img class="fileimg" ms-attr-itemid="item.ID" ms-src="/images/NewIndex/qywd/{{item.type=='folder'?'file1':item.FileExtendName}}.png" onerror="javascript: this.src = '/images/NewIndex/qywd/file.png'">
                <!--ms-class-1="copy:(PasteData>0&&PasteData[0].copycutid==item.ID)"-->
                <i class="iconfont icon-xitongshoucang" ms-if="item.CollectUser.indexOf(model.nowuser) >= 0" style="font-size:12px; "></i>
                <a href="#" ms-attr-title="item.Name">{{item.Name}}</a>
            </li>
        </ul>
    </script>
    <script type="avalon" id="userlist">
        <ol class="breadcrumb" style="margin-bottom:0;font-weight:bold;background-color:white">
            <li onclick="initdata()"><a href="#">共享文档</a></li>
        </ol>
        <ul class="listContent" ms-controller="APP_QYWD_GX">
            <li class="lifile hvr-float-shadow" ms-repeat-item="userlist" ms-on-dblclick="enteruser(item.CRUser)">
                <img class="fileimg" src="/images/NewIndex/qywd/file1.png" onerror="javascript: this.src = '/images/NewIndex/qywd/file.png'">
                <span style="margin-top:5px;font-size:14px">{{ComFunJS.convertuser(item.CRUser)}}</span>
            </li>
        </ul>
    </script>
    <div class="container-fluid maindiv" style="margin-top: 20px" id="dvContent">
        <div style="width:120px;position:absolute">
            <ul class="list-group text-center  leftmenu ">
                <li class="list-group-item " onclick="location.href='APP_QYWD_GR.html'">
                    <div>
                        <i class="iconfont hvr-grow">&#xe62c;</i>
                    </div>
                    <div>我的文档</div>
                </li>
                <li class="list-group-item " style="border-top:0;margin-top:2px" onclick="location.href='APP_QYWD.html'">
                    <div>
                        <i class="iconfont  icon-qiyedanganguanli hvr-grow "></i>


                    </div>
                    <div>企业文档</div>
                </li>
                <li class="list-group-item sel" style="border-top:0;margin-top:2px" onclick="location.href='APP_QYWD_GX.html'">
                    <div>
                        <i class="iconfont icon-houxutubiao98 hvr-grow "></i>


                    </div>
                    <div>共享文档</div>
                </li>
                <li class="list-group-item  " style="border-top:0;margin-top:2px" onclick="location.href='APP_QYWD_SC.html'">
                    <div>
                        <i class="iconfont icon-wodeshoucang hvr-grow "></i>
                    </div>
                    <div>我的收藏</div>
                </li>
            </ul>
        </div>
        <div class="row" style="margin-left:121px">
            <div class="col-xs-12">
                <!--<div class="panel panel-default">
                    <div class="panel-body">
                        <div class="row">
                            <div class="col-xs-6">
                                <div class="input-group">
                                    <input type="text" ms-keypress="jptjsearch(event)" class="form-control" ms-duplex="searchkey" placeholder="输入文件名或后缀名搜索文件,按CTRL+ENTER键搜索">
                                    <span class="input-group-btn">
                                        <button class="btn btn-default" type="button" ms-click="searchfile()">搜索</button>
                                        <button class="btn btn-danger" ms-if="searchkey.length>0" type="button" ms-click="clearsearch()">清除</button>
                                    </span>
                                </div>
                            </div>
                            <div class="col-xs-6">
                            </div>
                        </div>
                    </div>
                </div>-->
                <div class="panel-default panel">
                    <div class="panel-heading">
                        <div class="row">
                            <div class="col-xs-11 ">
                                <!--<div class="btn-group" role="group">
                                    <button type="button" ms-attr-disabled="viewkey!='tpllist'" ms-click="addFile()" class="btn btn-primary"><i class="fa fa-upload"></i>&nbsp;上传文件</button>
                                    <button type="button" ms-attr-disabled="viewkey!='tpllist'" id="conaddfolder" class="btn btn-default" data-toggle="modal" data-target="#UpdateNameModal"><i class="fa fa-folder-o"></i>&nbsp;新建文件夹</button>
                                </div>-->
                                <div class="btn-group" role="group" ms-if="SelItemData.size()>0" style="margin-left:10px">
                                    <button type="button" class="btn btn-default " ms-click="downloaditem()"><i class="fa fa-download"></i>&nbsp;下载</button>
                                    <!--<button type="button" class="btn btn-default " ms-click="copycutdata('copy')"><i class="fa fa-copy"></i>&nbsp;复制</button>
                                    <button type="button" class="btn btn-default " ms-click="copycutdata('cut')"><i class="fa fa-cut"></i>&nbsp;剪切</button>
                                    <button type="button" class="btn btn-danger " ms-click="delitems()"><i class="fa fa-trash-o"></i>&nbsp;删除</button>-->
                                </div>
                                <!--<div class="btn-group" role="group" ms-if="SelItemData.size()==1" style="margin-left:10px">
                                    <button type="button" class="btn btn-info dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                                        分享<span class="caret"></span>
                                        <span class="sr-only"></span>
                                    </button>
                                    <ul class="dropdown-menu">
                                        <li ms-click="ShareItem()"><a href="#"><i class="fa fa-share-alt"></i>&nbsp;外部分享</a></li>
                                        <li ms-click="SetAuth()"><a href="#"><i class="fa fa-wrench"></i>&nbsp;内部共享</a></li>

                                    </ul>

                                </div>-->
                            </div>
                            <div class="col-xs-1 text-right">
                                <i class="fa fa-list-ul hidden"></i>
                                <i class="fa fa-th" style="line-height: 34px;font-size: 20px;color:#3085DB"></i>
                            </div>
                        </div>
                    </div>
                    <div class="panel-body wdlist" ms-include="viewkey" data-include-rendered='listrender' style="min-height:400px;max-height:600px">
                    </div>
                    <div class="panel-footer text-right" ms-if="viewkey =='tpllist'">
                        <span>  共包含{{ListData.size()}}项</span>
                    </div>
                </div>
            </div>
            <div id="context-menu" class="conMenu" ms-visible="SelItemData.size()==1">
                <ul class="dropdown-menu" role="menu">
                    <li ms-click="downloaditem()"><a href="#">&nbsp;下载</a></li>
                    <!--<li><a href="#">&nbsp;重命名</a></li>
                    <li><a href="#">&nbsp;复制</a></li>
                    <li><a href="#">&nbsp;剪切</a></li>
                    <li><a href="#">&nbsp;删除</a></li>
                    <li role="separator" class="divider"></li>-->
                    <li ms-visible="!menuattr.issc"><a href="#">&nbsp;收藏</a></li>
                    <li style="background-color:antiquewhite" ms-visible="menuattr.issc"><a href="#">&nbsp;取消收藏</a></li>
                    <!--<li ms-class-1="active:menuattr.isfx"><a href="#">&nbsp;外部分享</a></li>
                    <li ms-class-1="active:menuattr.isgx"><a href="#">&nbsp;内部共享</a></li>
                    <li role="separator" class="divider"></li>
                    <li><a href="#">&nbsp;&nbsp;属性</a></li>-->
                </ul>
            </div>
        </div>
    </div>
    <script src="/Scripts/jquery-1.11.2.min.js"></script>
    <script src="/Scripts/avalon.min.js"></script>
    <script src="/Scripts/SZHLCommon.js?jsver=5"></script>
    <script src="/Scripts/contextmenu.js"></script>
    <script src="/CSS/bootstrap3.3.5/js/bootstrap.min.js"></script>
    <script>
        var rootpath = "";

        var damodel = avalon.define({
            $id: "APP_QYWD_GX",
            userlist: [],
            seluser: "",
            initdata: function () {
                $.getJSON('/API/FTAPI.ashx?Action=GETNBUSERS', { P1: "" }, function (resultData) {
                    if (resultData.ErrorMsg == "") {
                        damodel.userlist = resultData.Result;
                        model.viewkey = "userlist";

                    }
                })
            },
            enteruser: function (user) {
                $.getJSON('/API/FTAPI.ashx?Action=GETNBSHARELIST', { P1: user }, function (resultData) {
                    if (resultData.ErrorMsg == "") {
                        // damodel.ListData = resultData.Result.concat(resultData.Result);
                        resultData.Result.forEach(function (item) {
                            item.issel = false;
                            item.type = "folder";
                        })
                        resultData.Result1.forEach(function (item) {
                            item.issel = false;
                            item.type = "file";

                        })
                        model.ListData = resultData.Result.concat(resultData.Result1);
                        model.SelItemData.clear();
                        model.viewkey = "tpllist";

                        damodel.seluser = user;
                        model.Pathdata.clear()
                    }
                })
            }
        })
        avalon.ready(function () {
            model.Pathdata.clear();

            ComFunJS.initsetajax();
            damodel.initdata();
        })
    </script>
    <script src="/View/APPBaseView/QYWD/avalfile.js"></script>
</body>
</html>
